﻿Public Class _Default
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        ' The following code gets the client context and Title property by using TokenHelper. 
        ' To access other properties, you may need to request permissions on the host web.
        Dim contextToken As String = TokenHelper.GetContextTokenFromRequest(Page.Request)
        Dim hostWeb As String = Page.Request("SPHostUrl")
 
        Using clientContext = TokenHelper.GetClientContextWithContextToken(hostWeb, contextToken, Request.Url.Authority)
            clientContext.Load(clientContext.Web)
            clientContext.ExecuteQuery()
            Response.Write(clientContext.Web.Title)
        End Using
    End Sub
End Class